<template>
  <el-table
    ref="table"
    v-loading="page.loading"
    border
    :data="data.tableData"
    row-key="System_10_10"
    height="100%"
    highlight-current-row
    @row-click="OnrowClick"
  >
    <!-- <el-table-column type="selection" width="40"> </el-table-column> -->
    <el-table-column type="index" width="40"> </el-table-column>
    <el-table-column prop="System_10_20" label="角色"> </el-table-column>
  </el-table>
</template>

<script>
import { System10 } from "@/api";
export default {
  data() {
    return {
      //页面控制
      page: { loading: false },
      //数据
      data: { tableData: [] }
    };
  },
  //外部属性
  props: {},
  //内部方法
  methods: {
    async initPage() {
      this.data.tableData = await System10.get();
      this.$nextTick(() => {
        setTimeout(() => {
          this.$refs.table.setCurrentRow(this.data.tableData[0]);
          this.$emit("rowClick", this.data.tableData[0]);
        }, 1500);
      });
    },
    OnrowClick(row) {
      this.$emit("rowClick", row);
    }
  },
  //组件
  components: {},
  //初始化 异步加async await
  mounted() {
    this.initPage();
  },
  //计算属性
  computed: {},
  //监视
  watch: {}
};
</script>

<style lang="scss" scoped></style>
